<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/layout.css" />
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/module_public.css" />
  <script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Js/My97DatePicker/WdatePicker.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Js/system.js"></script>
</head>
<body>
  <div class="module_public">
     <div class="module_public_content">
        <h1> >> 管理项目 <a href="__ACTION__">【刷新】</a></h1>
     </div>
	<div class="module_public_main">
       <table>
         <tr>
           <td width="8%" align="center">编号</td>
           <td align="center">项目名称</td>
           <td align="center">项目负责人</td>
           <td align="center">开始时间</td>
           <td align="center">完成进度</td>
           <td align="center">文档</td>
           <td align="center">操作</td>
         </tr>
         <?php if(is_array($p_info)): $k = 0; $__LIST__ = $p_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($k % 2 );++$k;?><tr>
           <td width="8%" align="center"><?php echo ($k); ?></td>
           <td align="center"><?php echo ($v["p_title"]); ?></td>
           <td align="center"><?php echo ($v["p_manage"]); ?></td>
           <td align="center"><?php echo (date("Y年m月d日",$v["p_starttime"])); ?></td>
           <td><?php echo ($v["p_progress"]); ?>%
              <table style="width:<?php echo ($v["p_progress"]); ?>%">
                  <tr style="background:#F90;">
                     <td style="color:#FFF;"></td>
                  </tr>
              </table>
           </td>
           <?php if($v["p_document"] == ''): ?><td align="center"><font color=red>x</font></td>  
           <?php else: ?>
           <td align="center"><font color=green>√</font></td><?php endif; ?>
           <td align="center">
              <a href="#" id="uploads" title="<?php echo ($v["p_id"]); ?>">上传文档</a> |
              <?php if($v["p_document"] == ''): ?><a href="#">暂无文档</a> |
              <?php else: ?>
              <a href="__PUBLIC__/project_doc/<?php echo ($v["p_document"]); ?>">下载文档</a> |<?php endif; ?>
              <a href="__URL__/edit_project/pid/<?php echo ($v["p_id"]); ?>">修改项目信息</a> |
              <a href="__URL__/look_project/pid/<?php echo ($v["p_id"]); ?>">查看项目详细</a> |
              <a href="__URL__/project_log/pid/<?php echo ($v["p_id"]); ?>">项目日志</a> |
              <a href="__URL__/project_del/pid/<?php echo ($v["p_id"]); ?>" onclick="if(confirm('删除项目,也会删除相应的项目日志?')){return true;}else{return false};">删除项目</a>
           </td>
         </tr><?php endforeach; endif; else: echo "" ;endif; ?>
       </table>
       <iframe style="width:0; height:0; border:0;" name="form-target"></iframe>
       <p id="pp"></p>
	</div>
    <script type="text/javascript">
	   $("#uploads").click(function(){
		  var pid = $(this).attr("title");
		  //获取点击元素的坐标
	  	  var position = $(this).offset();
	  	  var x = position.left;
	  	  var y = position.top;  
		  
		  var div_upload = $("<div style='width:300px;height:130px;border:1px solid #CCC;display:none;background:#F0F0F0;position:absolute;left:"+x+"px;top:"+y+"px;padding:10px;'><fieldset style='padding:10px;'><legend>上传项目文档</legend><form action='__URL__/do_projectUpload' method='post' enctype='multipart/form-data' target='form-target'><input type='hidden' name='pid' value='"+pid+"' /><p>上传:<input type='file' name='xiangmu_doc' /></p><p style='margin-top:10px;text-align:left;margin-left:20px;'><input type='button' id='on_submit' value='上传' style='margin-left:10px;'/><input type='reset' value='重置' style='margin-left:10px;'/><input type='button' id='close' value='关闭' style='margin-left:10px;'/></p></form><p style='margin-top:10px;'><font color=green>注:如果您需要更改文档,直接上传即可覆盖原先的文档</p></fieldset></div>");
		  $("body").append(div_upload);
		  div_upload.slideDown(1000);
		  
		  $("#close").click(function(){
			 div_upload.remove();
		  });
		  
		  $("#on_submit").click(function(){
			  $("form:first").submit();
		  });
	   });
	   

	</script>
  </div>
</body>
</html>